home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ITBBSADD.ZIP / INTEREOR.ASM < prev    next >
Assembly Source File  |  1997-08-16  |  18KB  |  341 lines

  1. ; BBSTRO for Intereor WHQ bbs! [SysGod: Zyark] [+45 36701219]
  2. ; Code & Graphics by CyPoxl of Intereor productions
  3. ; Font by Sector/Intereor                           
  4. ; Thanks to Vulture of Outlaw Triad for the plasma...
  5. ; Code suxx, I know... [Not yours Vulture] - AND it is pretty old stuff! :(
  6. ; Lots of confusing comments :)
  7.  Dosseg                         ; Ehh, who cares?.. we only got 1 seg to play with
  8.  Model Tiny                     ; 1 seg := c0m file
  9.  Jumps                          ; Nice looong jumps :)
  10.  Code   Segment                 ; Instead of .code we make our own code seg..
  11.  Assume Cs:Code, Ds:Code, Es:Code; e.g: Totally irrelevant!
  12.  Org 100h                       ; c0m entry point
  13.                                                   
  14. ;[][][][][][][][][][][][][][][][][][MACROS][][][][][][][][][][][][][][][][][]
  15.                                                        
  16. WaitVRT         Macro           ; Macro = happy word :)
  17.         Local @Vrt, @Vrt2
  18.  Mov Dx,3dah                    ; Vga reg [status register]
  19. @Vrt:                                                                
  20.  In Al,Dx                       ; Get Status
  21.  Test Al,8                      ; Vertical retrace?
  22.  Jz @Vrt                        ; Nope      
  23. @Vrt2:                                             
  24.  In Al,Dx                                          
  25.  Test Al,8                      ; Vertical Retrace?                   
  26.  Jnz @Vrt2                      ; Yer, now its time to write
  27. Endm                                                       
  28.                                                            
  29. ;[][][][][][][][][][][][][][][][][][]CODE[][][][][][][][][][][][][][][][][][]
  30.                                                            
  31. Intro           Proc                                       
  32.  Jmp Next                                   
  33.  Db '(c)ypoxl'                  ; (c)opyright CyPoxl '97, but who cares..?
  34. Next:                                                                     
  35.  Call SetVgaStuff               ; Init mode 13h, set palette..
  36.  Cli                            ; FuCK interrupts
  37.  Mov Dx,21h                     ; Interrupt mask reg!      
  38.  In Al,Dx                                            
  39.  Mov Byte Ptr Ds:[OldIRQs],Al                    
  40.  Or Al,11b                      ; Turn off keyboard and timer interrupt
  41.  Out Dx,Al                                  
  42.  Xor Di,Di
  43.  Lea Si,ITlogo                                                
  44.  Mov Cx,15021                                                 
  45.  Rep Movsb                                                    
  46.  Mov Di,47*320                  ; After logo     
  47.  Mov Al,64                      ; e.g blueish
  48.  Call MakeBar                   ; Draw nice bar  
  49.  Mov Di,143*320                 ; After plasma/before font
  50.  Xor Al,Al                      ; Greyish   
  51.  Call MakeBar                                              
  52.  Mov Di,173*320                 ; After font     
  53.  Xor Al,Al                      ; Greyish [like font]
  54.  Call MakeBar                                    
  55.  Mov Bp,140                     ; 10x14 equals...?
  56. @StartTxt:                                        
  57.  Lea Bx,IntereorTxt             ; Pointer to txt  
  58. @GetChar:                                         
  59.  Mov Al,byte ptr Ds:[Bx]        ; Get Char
  60.  Inc Bx                         ; Point to next char in Txt
  61.  Xor Ah,Ah                      ; I forgot why..uhm.. think its cuz we multiply
  62.  Or Al,Al                       ; Zero indicator?
  63.  Jz @StartTxt                   ; All over...again
  64.  Cmp Al,' '                     ; Space?
  65.  Jnz @NotSpace                  ; Not space       
  66.  Mov Dh,8                       ; 8 vertical lines
  67.  Call MoveXScreen               ; If you cant guess I wont tell ya
  68.  Jmp @GetChar                                     
  69. @NotSpace:                                        
  70.  Lea Si,Font                    ; Font pointer    
  71.  Sub Al,'('                     ; Start char = '('
  72.  Mul Bp                         ; Calculate offset in font [Bp=140]
  73.  Add Si,Ax                      ; ^^^^^^^^^^^^^^^^^^^^^^^^
  74.  Mov Cl,10                      ; 10 like in 10x14 font!
  75. @HLine:                                           
  76.  Push Si                        ; Save Si, cuz we mess with it
  77.  Mov Di,159*320+280-1           ; Very hardcore calculation, hehe :)
  78.  Mov Ch,14                      ; 14 like in..... 
  79. @VLine:                                
  80.  Movsb                          ; Move string byte (Font => Screen)
  81.  Add Di,320-1                   ; Next line (on screen)
  82.  Add Si,10-1                    ; Next byte in font [vertical]
  83.  Dec Ch            
  84.  Jnz @VLine                     ; Not through with vertical line
  85.  In Al,60h                      ; Keyboard reg
  86.  Cmp Al,1                       ; Check Escape
  87.  Jz QuitIntro                   ; Quit on escape
  88.  Call MoveScreen                ; Next vertical line
  89.  Call Do_Plasma                 ; Hmm...      
  90.  Pop Si                         ; Font in si 
  91.  Inc Si                         ; Next byte in font
  92.  WaitVRT           
  93.  Loop @HLine                    ; Next vertical line
  94.  Mov Dh,2                       ; Dist between letters
  95.  Call MoveXScreen                               
  96.  Jmp @GetChar                                   
  97. QuitIntro:                                      
  98.  Sti
  99.  Mov Ax,3                       ; Init text mode [80x25x16c]
  100.  Int 10h                                        
  101.  Call DispAnsi                  ; Nice ansi w. softscroll :)
  102.  Cli
  103.  Mov Dx,21h
  104.  Mov Al,Byte Ptr Ds:[OldIRQs]   ; Old IRQ settings
  105.  Out Dx,Al                      ; Trust me, the user will like this, hehe :)
  106.  Sti                                            
  107.  Mov Ax,4C00h                   ; Save terminate function
  108.  Int 21h                        ; TermiNate Prog         
  109. Intro           Endp                                     
  110.                                                          
  111. MoveXScreen     Proc                                     
  112.  Call MoveScreen                ; Move screen
  113.  Call Do_Plasma                 ; Remember to update plasma
  114.  Push Dx                                                 
  115.  WaitVRT
  116.  Pop Dx                                                  
  117.  Dec Dh
  118.  Jnz MoveXScreen                ; Counter=0?             
  119.  Ret                                                     
  120. MoveXScreen     Endp
  121.                                                             
  122. MoveScreen      Proc                                        
  123.  Push Cx Es                     ; Cx must not be messed with
  124.  Pop Ds                                                      
  125.  Mov Si,159*320+40+1            ; Source
  126.  Mov Di,159*320+40              ; Destination=source-1
  127.  Mov Dl,14                      ; 10x14 font!
  128. @MV:                                                        
  129.  Mov Cx,240                     ; Scroll window size
  130.  Rep Movsb                                                   
  131.  Add Di,320-240                                                              
  132.  Add Si,320-240                
  133.  Dec Dl                         ; Dl=counter
  134.  Jnz @MV                       
  135.  Push Cs                                                     
  136.  Pop Ds Cx                                                   
  137.  Ret                                                         
  138. MoveScreen      Endp                                        
  139.                                                             
  140. SetVgaStuff     Proc                    
  141.  Mov Ax,13h                     ; Init mode 13h [320x200x256c]
  142.  Int 10h                                 
  143.  Mov Ax,0A000h                  ; Vga seg
  144.  Mov Es,Ax                      ; Es:Di [for stosb]
  145.  Lea Si,Palette                 ; Plasma+font pal
  146.  Mov Cx,243*3                   ; RGB            
  147.  Mov Dx,3C8h                    ; Pal reg index  
  148.  And Al,0                       ; Eg: Xor Al,Al / Sub Al,Al
  149.  Out Dx,Al                      ; Start with 1st color
  150.  Inc Dl                         ; Pal reg data [write only]
  151. @Out:                                                      
  152.  Mov Al,Byte Ptr Ds:[Si]        ; Get R/G/B Val
  153.  Out Dx,Al                      ; Store it in vga reg
  154.  Inc Si                         ; Next
  155.  Loop @Out
  156.  Ret                                                        
  157. SetVgaStuff     Endp                                       
  158.                                                            
  159. Do_Plasma       proc                                       
  160.  Push Bx Cx Dx Bp               ; Save [maybe to many] regs
  161.  Mov Di,60+320*63               ; Plasma pos [x,y=60,16]
  162.  Mov Cl,Byte Ptr Ds:[Co1]       ; Vertical cosine start values
  163.  Mov Ch,Byte Ptr Ds:[Co2]
  164.  Mov Ah,80                      ; 80 vertical lines
  165. @Outer_Plasma:                                               
  166.  Push Ax                                                
  167.  Mov Dl,Byte Ptr Ds:[Co3]       ; Horizontal cosine start values
  168.  Mov Dh,Byte Ptr Ds:[Co4]                             
  169.  Mov Ah,100                     ; 200 horizontal lines [YES: 200!]
  170. @Inner_Plasma:                  
  171.  Xor al,Al                          
  172.  Xor bh,bh                          
  173.  Mov Bl,Dl                      ; Add 4 cosine values
  174.  Add Al,Byte Ptr Ds:[Cosine+Bx]     
  175.  Mov Bl,Dh                          
  176.  Add Al,Byte Ptr Ds:[Cosine+Bx]  
  177.  Mov Bl,Cl                       
  178.  Add Al,Byte Ptr Ds:[Cosine+Bx]  
  179.  Mov Bl,Ch                       
  180.  Add Al,Byte Ptr Ds:[Cosine+Bx]  
  181.  And Al,01111111b                
  182.  Mov Byte Ptr Es:[Di],Al        ; Store Color on Vga
  183.  Inc Di                         ; Leave 1 pixel black
  184.  Inc Di                         ; Thats why we have 200 horizontal pixels
  185.  Add Dl,1                                                                 
  186.  Add Dh,2                       
  187.  Dec Ah                         ; Next pixel on horizontal line
  188.  Jnz @Inner_Plasma                                 
  189.  Add Cl,3                                          
  190.  Add Ch,4                                          
  191.  Add Di,120                     
  192.  Pop Ax                                            
  193.  Dec Ah                         ; Next horizontal line
  194.  Jnz @Outer_Plasma                                 
  195.  Sub [Co1],4                                       
  196.  Add [Co2],3                                       
  197.  Sub [Co3],2                                       
  198.  Add [Co4],1                                       
  199.  Pop Bp Dx Cx Bx                
  200.  Ret                                               
  201. Do_Plasma       endp                              
  202.                    
  203. MakeBar Proc                     
  204.  Mov Bx,16                      ; 16 shades
  205. @MakeIt:                                                     
  206.  Mov Cx,320                     ; Guess...
  207.  Rep Stosb                       
  208.  Add Al,4                       ; Next color
  209.  Dec Bx                         ; Bx=counter
  210.  Jnz @MakeIt                                 
  211.  Ret                                         
  212. MakeBar Endp             
  213.           
  214. DispAnsi        Proc            ; I figured this out - all by myself! :-)
  215.  Push Cs                        ; So..
  216.  Pop Ds                         ; Ds=cs
  217.  Mov Al,0ah                     ; Index [cursor]
  218.  Mov Ah,100000b                 ; Bit 5 (6) [cursor 0=on 1=off]
  219.  Mov Dx,3D4h                    
  220.  Out Dx,Ax                      
  221.  Mov Ax,0B800h                  ; Color text seg
  222.  Mov Es,Ax                                                     
  223.  Mov Cx,4000                    ; Just to be save
  224.  Xor Ax,Ax                      ; 000000000etc...
  225.  Cld                             
  226.  Rep Stosw                      ; Clear 2 pages
  227.  Mov Ax,501h                    ; Select page 1 [normally we have page 0]
  228.  Int 10h
  229.  Cli                            ; Don't want any interrupts to..interrupt :)
  230.  WaitVRT                        ; Otherwise we'll get to see the logo for a very short time
  231.  Xor Di,Di                      ; Page 0:0
  232.  Lea Si,Ansi                    ; My own ansi
  233.  Mov Cx,80*15                   ; 15 lines long
  234.  Rep Movsw                      ; Put in on page 0
  235.  Mov Bx,80*15                   ; Set the screen offset just below the ansi!
  236.  Call SetMemAdd                 ; Cuz we want to scroll it down
  237.  Mov Cx,15                      ; Ansi hight!
  238. @RowLoop:                       
  239.  Push Cx                                
  240.  Sub Bx,80                      ; Next Row
  241.  Call SetMemAdd                 ; In display memory
  242.  WaitVRT                                
  243.  Mov Ax,0f08h                   ; Display last pixel of chars
  244.  Mov Dx,3D4h                    ; Vga Reg !!!
  245.  Out Dx,Ax                              
  246.  Dec Ah                         ; Display one more pixel
  247.  Mov Cx,15                      ; Cuz We have set the 1st, and now there are
  248. @PixelLoop:                     ; 15 to go [vgafont: 8x16]
  249.  WaitVRT                        ; Wait until Vertical Retrace!
  250.  Mov Dx,3D4h                    ; I hope this works on all adaptors..
  251.  Mov Al,8                                                             
  252.  Out Dx,Ax                                                            
  253.  Dec Ah                         
  254.  Loop @PixelLoop                ; Next Pixel
  255.  Pop Cx                                      
  256.  Loop @RowLoop                  ; Next row
  257.  Sti                            ; Turn on interrupts
  258.  Mov Ax,500h                    ; Turn on page 0
  259.  Int 10h                                         
  260.  Mov Ax,0B0Ah                   ; Start cursor scanline
  261.  Out Dx,Ax                              
  262.  Mov Ax,0D0Bh                   ; End cursor scanline
  263.  Out Dx,Ax                              
  264.  Ret                                    
  265. DispAnsi        Endp                            
  266.                                                 
  267. SetMemAdd       Proc                            
  268.  Push Ax                                         
  269.  Mov Dx,3D4h                    ; ...Vga reg!
  270.  Mov Al,0Ch                                   
  271.  Mov Ah,Bh                      ; High address
  272.  Out Dx,Ax                      
  273.  Inc Al                                          
  274.  Mov Ah,Bl                      ; Low address
  275.  Out Dx,Ax                                     
  276.  Pop Ax                                       
  277.  Ret                                          
  278. SetMemAdd       Endp                         
  279.                                                              
  280. ;[][][][][][][][][][][][][][][][][][]DATA[][][][][][][][][][][][][][][][][][]
  281. IntereorTxt     Label   Byte               
  282.         Db 'INTEREOR WHQ BBS      '        
  283.         Db '(+45) 367-012-19      '          
  284.         Db 'CALL NOW?              '; ?=! ! [forget it..You'll notice :)]
  285.         Db '                        '                                 
  286.         Db 'SYSOP: ZYARK       '                                      
  287.         Db 'LOTS OF XM/MOD, DEMOS, ETC...      '                      
  288.         Db '                        '                                 
  289.         Db 'GREETS: VULTURE/OT       '
  290.         Db 'MOTIVE/INTEREOR         ' 
  291.         Db 'NARCOID/SMERSH       '                                    
  292.         Db '                        '                                 
  293.         Db 'INTEREOR WHQ BBS      '                                   
  294.         Db '(+45) 367-012-19      '                                   
  295.         Db 'CALL NOW?              '                                  
  296.         Db '                       '                                  
  297.         Db 'CODE: CYPOXL/INTEREOR    '                                
  298.         Db 'GRAPHICS: CYPOXL    '                                     
  299.         Db 'FONT: SECTOR/INTEREOR      '
  300.         Db '                        '                                 
  301.         Db 0                    ; DONE
  302.                                                                       
  303. Label Palette Byte                                                        
  304.  I = 0                                                                
  305. Rept 32                         ; 32 increasing colors of white
  306.         Db I,I,I                                                      
  307.  I = I + 1                            
  308. Endm                                  
  309.                                       
  310. Rept 32                         ; 32 decreasing colors of white
  311.         Db I,I,I                                                  
  312.  I = I - 1                            
  313. Endm         
  314.              
  315. Rept 32                         ; 32 increasing colors of blue
  316.         Db 0,0,I                                                 
  317.  I = I + 1                                                   
  318. Endm         
  319. Rept 32                         ; What could tjis beeee?
  320.         Db 0,0,I                                 
  321.  I = I - 1                                       
  322. Endm                                             
  323. ;Font colors:                                    
  324.         Db 3 Dup (3Fh)          ; White
  325.         Db 3 Dup (1Eh)          ; Less white
  326.         Db 3 Dup (0Eh)          ; Less than less white
  327. Include Logo.pal                ; logo.pal
  328.                                                       
  329. OldIRQs Db ?                    ; Old IRQ settings    
  330.                                                       
  331. Co1     Db ?                    ; 4 different angles  
  332. Co2     Db ?
  333. Co3     Db ?                                     
  334. Co4     Db ?                                     
  335. Include cosine.dat              ; Cosine Values for plasma
  336. Include it-font.inc             ; Intereor font by Sector
  337. Include logo.inc                ; Intereor logo [by me - and my raytracer-, 
  338.                                 ; hehe]
  339. Include ansi.inc                ; Ansi logo [also by me :)]
  340. Code Ends                                                                        
  341. End Intro